import { request, HttpMethod, restartTimes, RequestConfig } from './request'
//用药管理相关操作

export const getAllDrugs = (patientUid: string) => {
  const config = <RequestConfig>{
    url: '/patient/eatDrugAlert/get_drug/'+patientUid,
    method: HttpMethod.GET,
  }
  return request(config);
}

export const deleteADrug = (pdeId: number) => {
  const config = <RequestConfig>{
    url: '/patient/eatDrugAlert',
    method: HttpMethod.DELETE,
    data: [pdeId],
  }
  return request(config);
}

export const changeDrugStatus = (data: Object) => {
  const config = <RequestConfig>{
    url: '/patient/eatDrugAlert',
    method: HttpMethod.PUT,
    data: data,
  }
  return request(config);
}

export const addDrug = (data: Object) => {
  const config = <RequestConfig>{
    url: '/patient/eatDrugAlert/add_drug_alert',
    method: HttpMethod.POST,
    data: data,
  }
  return request(config);
}